// File generated from our OpenAPI spec by Stainless.

package com.metest.api.models.rest.actuator.metrics

import com.metest.api.core.http.QueryParams
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class MetricRetrieveByNameParamsTest {

    @Test
    fun create() {
        MetricRetrieveByNameParams.builder()
            .requiredMetricName("requiredMetricName")
            .tag("tag")
            .build()
    }

    @Test
    fun pathParams() {
        val params =
            MetricRetrieveByNameParams.builder().requiredMetricName("requiredMetricName").build()

        assertThat(params._pathParam(0)).isEqualTo("requiredMetricName")
        // out-of-bound path param
        assertThat(params._pathParam(1)).isEqualTo("")
    }

    @Test
    fun queryParams() {
        val params =
            MetricRetrieveByNameParams.builder()
                .requiredMetricName("requiredMetricName")
                .tag("tag")
                .build()

        val queryParams = params._queryParams()

        assertThat(queryParams).isEqualTo(QueryParams.builder().put("tag", "tag").build())
    }

    @Test
    fun queryParamsWithoutOptionalFields() {
        val params =
            MetricRetrieveByNameParams.builder().requiredMetricName("requiredMetricName").build()

        val queryParams = params._queryParams()

        assertThat(queryParams).isEqualTo(QueryParams.builder().build())
    }
}
